using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Assets.Scripts;
using UnityEngine;

public class ShopModel : SingLetion<ShopModel>
{
    public Dictionary<int, ShopData> dic = new Dictionary<int, ShopData>();

    List<ShopData> shoplist = new List<ShopData>();
    List<ShopData> equipdatalist = new List<ShopData>();
    List<ShopData> druidatalist = new List<ShopData>();
    List<ShopData> boxdatalist = new List<ShopData>();
    public int Count;
   public int typeBtncount = 5; //分类按钮数量
    public void Init()
    {

        dic = ConFigMrg.ins.GetTble<Dictionary<int, ShopData>>("Shop");
        Count = 16;
        foreach (var item in dic.Values)
        {
            switch (item.inventoryType)
            {
                case "消耗品":
                    {
                        equipdatalist.Add(item);
                    }
                    break;
                case "药水":
                    {
                        druidatalist.Add(item);
                    }
                    break;
                case "啤酒":
                    {
                        boxdatalist.Add(item);
                    }
                    break;
                case "啤酒_0":
                    {
                        boxdatalist.Add(item);
                    }
                    break;
               
            }
            shoplist.Add(item);
        }

    }
    public List<ShopData> GetType(int typeBtnData)
    {
        switch (typeBtnData)
        {
            case 0:
                {
                    return shoplist;
                }
            case 1:
                {
                    return equipdatalist;
                }

            case 2:
                {
                    return druidatalist;
                }

            case 3:
                {
                    return boxdatalist;
                }
            case 4:
                {
                    return boxdatalist;
                }
        }
        return null;
    }

    
    

   
}
